<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="chrome=1">
    <title>editor</title>
</head>
<body>
<div class="box-content">
    <div class="box-head">
        <div class="head_title">接口使用列表</div>
        <div class="head_btn">

                <a href="/interfaceusage/add">新增</a>

        </div>
    </div>
    <div class="box-search">
        <form method="post" name="form1" id="form1" class="search_form">
            <div class="area">
                <label>接口名称：</label>
                <input type="text" class="search_input" id="title" name="name" value="{{.Name}}"
                       placeholder='名称'/>
            </div>
            <div class="btn_right">
                <input type="button" id="submit_form" class="form_btn"
                       value='查询'/>
            </div>
        </form>
    </div>
    <div class="box-body">
        <table class="tab_pub" id="tb-1">
            <thead>
            <tr class="row tab_rows1">
                <th class="td_center">ID</th>
                <th>接口名称</th>
                <th>API ID</th>
                <th>描述</th>
                <th class="td_center">操作</th>
            </tr>
            </thead>
            <tbody>
            {{range $vo := .list}}
                <tr class="rows_rest">
                    <td id="interface_id" class="td_center">{{$vo.Id}}</td>
                    <td class="td_title">

                            <a href="/interfaceusage/edit/id/{{$vo.Id}}" class="rows_hover">{{$vo.Name}}</a>

                    </td>
                    <td>{{$vo.ApiId}}</td>
                    <td>{{$vo.Description}}</td>
                    <td class="td_center">

                            <a href="/interfaceusage/edit/id/{{$vo.Id}}"
                               class="tab_edit">编辑</a>

                            <a href="/interfaceusage/delete/id/{{$vo.Id}}" class="tab_del"
                               id="change_status">删除</a>

                    </td>
                </tr>
            {{end}}
            </tbody>
        </table>
        <div class="box-footer">
            <div id="page_extra">
                {{.Page.TotalCount}}条 <span
                        id="page_num">{{.Page.TotalPage}}</span>页
                <input type="text" id="page_skip" placeholder='跳转页' autocomplete="off"/>
                <button id="page_sBtn">Go</button>
            </div>
            <ul class="page-nav" id="page"></ul>
        </div>
    </div>
</body>
<script src="/static/js/jquery-3.4.1.min.js" type="text/javascript"></script>
<script src="/static/js/bootstrap-paginator.min.js" type="text/javascript"></script>
<script src="/static/js/main.js"></script>
<script>
    var skillJs = {
        bootsPage: function () {
            var total = "{{.Page.TotalPage}}";
            var curPage = '{{.Page.PageNo}}';
            var tipArr = ['请输入正确的页码', '页数输入错误', '已经是当前页'];

            //搜索之后的分页分别处理
            function hrefn(page) {
                window.location.href = "/interfaceusage/list/?p=" + page + "&langs=" + $('.search_select').val() + "&name=" + "{{.Name}}";
            }

            //调用main.js的page方法
            Ai_ServerJs.page(total, curPage, tipArr, hrefn);
        },
        delOneList: function () {
            Ai_ServerJs.del('确定要删除此记录吗？');
        },
        submit: function () {
            $('#submit_form').click(function () {
                $("#form1").submit();
            });

            $('#form1').submit(function () {
                $('#title').val($.trim($('#title').val()));
                $('#cc').val($.trim($('#cc').val()));
            });
        },
        reset: function () {
            $('#reset').click(function () {
                $("#tag").val("");
                $("#title").val("");
                $("#form1").submit();
            });
        },
        notFind: function () {
            Ai_ServerJs.notFind('抱歉，未查询到信息');
        }

    }


    for (var i in skillJs) {
        if (typeof skillJs[i] == 'function') {
            skillJs[i]();
        }
    }

</script>
</html>